package thread;

/**
 * Creater with IntelliJ IDEA.
 * Description:
 * User: 86152
 * Dae: 2022-07-21
 * Time: 17:50
 */

class MyThread extends Thread {
    @Override
    public void run() {
        //任务
    }
}
class task implements Runnable{
    @Override
    public void run() {
        while(true) {
            ;
        }
    }
}
public class demo4 {
    public static void main(String[] args) {
//        Thread t = new Thread(new task());
//        t.start();
//        Thread t =new Thread(){
//          @Override
//          public void run() {
//              System.out.println("1");
//          }
//        };
//        t.start();
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("1");
            }
        });
        t.start();
    }
}
